#version 460
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_nonuniform_qualifier : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require


#include "../../../../core/shader_binding_ID.h"
#include "../../../../core/shader_std.h"
#include "../../../../core/shader_built_in_functions.h"



layout(location=0) out vec4 outColor;

//layout(early_fragment_tests) in;


layout(location=0) in vec4 inColor;
layout(location=1) in flat uint inShaderType;


const vec3 w = vec3(0.2125,0.7154,0.0721);

void main(void) {
	switch(inShaderType) {
		case DEF_FS_ShaderType_CirclePoint : 
		case DEF_3DShaderType_PerObCirclePoint : {
			vec2 c = (gl_PointCoord - 0.5) * 2;
			float d = dot(c, c);
			float w = (1 - min(d, 1)) * 3;
			outColor = inColor;

			//outColor = vec4(gl_FragCoord.z * gl_FragCoord.w);
			outColor.a = w;
			if (outColor.a < 0.01) discard;
			
			break;
		}
		default:{
			outColor = inColor;
		}
	}
	
}


